package com.blast.cn.ui

import android.view.KeyEvent
import com.blast.cn.R
import com.wxl.common.base.AbsActivity
import com.wxl.common.http.CommonHttpUtil
import com.wxl.common.room.entity.DetonatorEntity
import com.wxl.common.util.ObservableUtil
import kotlinx.android.synthetic.main.activity_service_layout.*

class ServiceActivity : AbsActivity() {

    override fun getCreateContentViewId(): Int {
        return R.layout.activity_service_layout
    }

    override fun onCreateViewChanged() {
        setTopTitle("售后服务")
        CommonHttpUtil.getDetonatorInfo(object : ObservableUtil.Companion.OnNextCallback<DetonatorEntity>(){
            override fun onNext(t: DetonatorEntity) {
                serviceCompanyText.text = t.deptid
                servicePhoneText.text = t.depttelphone
            }
        })
    }

    override fun onKeyDownEvent(keyCode: Int, event: KeyEvent?): Boolean {
        if(keyCode == KeyEvent.KEYCODE_BACK){
            finish()
        }
        return true
    }
}